package com.ruoyi.manage.service;

import java.util.Date;
import java.util.List;
import java.util.Map;
import com.ruoyi.manage.domain.CrInterviewAppointment;

/**
 * 面试预约Service接口
 * 
 * @author ruoyi
 * @date 2024-09-24
 */
public interface ICrInterviewAppointmentService 
{
    /**
     * 查询面试预约
     * 
     * @param appointmentId 面试预约主键
     * @return 面试预约
     */
    public CrInterviewAppointment selectCrInterviewAppointmentByAppointmentId(Long appointmentId);

    /**
     * 查询面试预约列表
     * 
     * @param crInterviewAppointment 面试预约
     * @return 面试预约集合
     */
    public List<CrInterviewAppointment> selectCrInterviewAppointmentList(CrInterviewAppointment crInterviewAppointment);

    /**
     * 新增面试预约
     * 
     * @param crInterviewAppointment 面试预约
     * @return 结果
     */
    public int insertCrInterviewAppointment(CrInterviewAppointment crInterviewAppointment);

    /**
     * 修改面试预约
     * 
     * @param crInterviewAppointment 面试预约
     * @return 结果
     */
    public int updateCrInterviewAppointment(CrInterviewAppointment crInterviewAppointment);

    /**
     * 批量删除面试预约
     * 
     * @param appointmentIds 需要删除的面试预约主键集合
     * @return 结果
     */
    public int deleteCrInterviewAppointmentByAppointmentIds(Long[] appointmentIds);

    /**
     * 删除面试预约信息
     * 
     * @param appointmentId 面试预约主键
     * @return 结果
     */
    public int deleteCrInterviewAppointmentByAppointmentId(Long appointmentId);

    /**
     * 根据学生ID查询预约列表
     * 
     * @param studentId 学生ID
     * @return 预约列表
     */
    public List<CrInterviewAppointment> selectAppointmentsByStudentId(Long studentId);

    /**
     * 根据社团ID查询预约列表
     * 
     * @param clubId 社团ID
     * @return 预约列表
     */
    public List<CrInterviewAppointment> selectAppointmentsByClubId(Long clubId);

    /**
     * 根据面试时段ID查询预约列表
     * 
     * @param slotId 面试时段ID
     * @return 预约列表
     */
    public List<CrInterviewAppointment> selectAppointmentsBySlotId(Long slotId);

    /**
     * 学生预约面试
     * 
     * @param studentId 学生ID
     * @param slotId 面试时段ID
     * @param applicationId 申请ID
     * @param remarks 备注
     * @return 结果
     */
    public int bookInterview(Long studentId, Long slotId, Long applicationId, String remarks);

    /**
     * 取消面试预约
     * 
     * @param appointmentId 预约ID
     * @param userId 用户ID
     * @param reason 取消原因
     * @return 结果
     */
    public int cancelAppointment(Long appointmentId, Long userId, String reason);

    /**
     * 确认面试预约
     * 
     * @param appointmentId 预约ID
     * @param clubId 社团ID
     * @return 结果
     */
    public int confirmAppointment(Long appointmentId, Long clubId);

    /**
     * 完成面试并评价
     * 
     * @param appointmentId 预约ID
     * @param clubId 社团ID
     * @param interviewResult 面试结果
     * @param interviewScore 面试得分
     * @param interviewFeedback 面试反馈
     * @return 结果
     */
    public int completeInterview(Long appointmentId, Long clubId, String interviewResult, 
                                Integer interviewScore, String interviewFeedback);

    /**
     * 学生对面试进行反馈
     * 
     * @param appointmentId 预约ID
     * @param studentId 学生ID
     * @param studentFeedback 学生反馈
     * @param satisfactionRating 满意度评分
     * @return 结果
     */
    public int submitStudentFeedback(Long appointmentId, Long studentId, String studentFeedback, 
                                    Integer satisfactionRating);

    /**
     * 重新安排面试时间
     * 
     * @param appointmentId 预约ID
     * @param newSlotId 新时段ID
     * @param rescheduleReason 重新安排原因
     * @return 结果
     */
    public int rescheduleAppointment(Long appointmentId, Long newSlotId, String rescheduleReason);

    /**
     * 批量确认预约
     * 
     * @param appointmentIds 预约ID数组
     * @param clubId 社团ID
     * @return 结果
     */
    public int batchConfirmAppointments(Long[] appointmentIds, Long clubId);

    /**
     * 检查学生是否有时间冲突
     * 
     * @param studentId 学生ID
     * @param slotId 面试时段ID
     * @return 是否冲突
     */
    public boolean checkStudentTimeConflict(Long studentId, Long slotId);

    /**
     * 检查面试官是否有时间冲突
     * 
     * @param interviewerId 面试官ID
     * @param slotId 面试时段ID
     * @return 是否冲突
     */
    public boolean checkInterviewerTimeConflict(Long interviewerId, Long slotId);

    /**
     * 获取学生的预约统计
     * 
     * @param studentId 学生ID
     * @return 统计信息
     */
    public Map<String, Object> getStudentAppointmentStatistics(Long studentId);

    /**
     * 获取社团的预约统计
     * 
     * @param clubId 社团ID
     * @return 统计信息
     */
    public Map<String, Object> getClubAppointmentStatistics(Long clubId);

    /**
     * 获取面试时段的预约统计
     * 
     * @param slotId 面试时段ID
     * @return 统计信息
     */
    public Map<String, Object> getSlotAppointmentStatistics(Long slotId);

    /**
     * 查询需要提醒的预约
     * 
     * @param hours 提前小时数
     * @return 预约列表
     */
    public List<CrInterviewAppointment> getAppointmentsForReminder(int hours);

    /**
     * 发送预约提醒
     * 
     * @param appointmentId 预约ID
     * @return 结果
     */
    public int sendAppointmentReminder(Long appointmentId);

    /**
     * 批量发送预约提醒
     * 
     * @param appointmentIds 预约ID数组
     * @return 结果
     */
    public int batchSendReminders(Long[] appointmentIds);

    /**
     * 查询过期未处理的预约
     * 
     * @return 预约列表
     */
    public List<CrInterviewAppointment> getExpiredAppointments();

    /**
     * 自动处理过期预约
     * 
     * @return 处理数量
     */
    public int processExpiredAppointments();

    /**
     * 导出预约数据
     * 
     * @param crInterviewAppointment 查询条件
     * @return 预约列表
     */
    public List<CrInterviewAppointment> exportAppointments(CrInterviewAppointment crInterviewAppointment);
}